<style>
    .cm-history-list {
        /*float: left;*/
        list-style: none;
        padding: 10px;
        margin: 0;
        padding: 10px;
    }

    .cm-history-item {
        float: left;
        position: relative;
        width: 100%;
        height: auto;
        min-height: 50px;
        margin: 10px 0;
    }

    .cm-history-item-head {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        cursor: pointer;
    }

    /* 左 */
    cm-history-othermessage {
        float: left;
        background: #eee;
        color: #000;
    }

    .cm-history-item-message {
        position: relative;
        display: flex;
        align-items: center;
        padding: 10px;
        margin: 0 15px;
        border-radius: 8px;
        max-width: calc(100% - 117px);
        word-break: break-word;
        font-size: 14px;
        min-height: 28px;
    }

    cm-history-othermessage:before {
        position: absolute;
        width: 0;
        height: 0;
        left: -10px;
        top: 15px;
        content: '';
        border-right: solid 10px #eee;
        border-top: solid 10px transparent;
        border-bottom: solid 10px transparent;
    }

    .cm-history-otherhead {
        float: left;
        margin-left: 15px;
    }

    .cm-history-othermessage {
        float: left;
        background: #eee;
        color: #000;
    }

    .cm-history-othermessage:before {
        position: absolute;
        width: 0;
        height: 0;
        left: -10px;
        top: 15px;
        content: '';
        border-right: solid 10px #eee;
        border-top: solid 10px transparent;
        border-bottom: solid 10px transparent;
    }

    .cm-history-item-message {
        position: relative;
        display: flex;
        align-items: center;
        padding: 10px;
        margin: 0 15px;
        border-radius: 8px;
        max-width: calc(100% - 117px);
        word-break: break-word;
        font-size: 14px;
        min-height: 28px;
    }

    /*    右*/
    .cm-history-mymessage {
        float: right;
        background: #2683f5;
        color: #fff;
    }

    .cm-history-item-message {
        position: relative;
        display: flex;
        align-items: center;
        padding: 10px;
        margin: 0 15px;
        border-radius: 8px;
        max-width: calc(100% - 117px);
        word-break: break-word;
        font-size: 14px;
        min-height: 28px;
    }

    .cm-history-mymessage:after {
        position: absolute;
        width: 0;
        height: 0;
        right: -10px;
        top: 15px;
        content: '';
        border-left: solid 10px #2683f5;
        border-top: solid 10px transparent;
        border-bottom: solid 10px transparent;
    }

    /* 右图*/
    .cm-history-myhead {
        float: right;
        margin-right: 15px;
    }

    .cm-history-item-head img {
        width: 90%;
        height: 90%;
    }

    /*   回复  ************ */
    .cm-content-down {
        position: absolute;
        width: 92%;
        bottom: -135px;
        background: #f8f8f8;
        border-top: solid 1px #ccc
    }

    .cm-content-input {
        height: calc(100% - 27px)
    }

    .cm-send-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 10px;
        bottom: 10px;
        width: 65px;
        height: 25px;
        color: #fff;
        font-size: 13px;
        cursor: pointer;
        border-radius: 5px;
        padding: 5px 2px
    }

    .cm-content-textarea {
        height: calc(100% - 20px);
        overflow-y: auto;
        width: calc(100% - 20px);
        border: none;
        padding: 10px;
        font-size: 14px;
        outline: 0
    }

    .cm-content-textarea::-webkit-scrollbar {
        width: 7px;
        height: 1px
    }

    .cm-content-textarea::-webkit-scrollbar-thumb {
        border-radius: 10px;
        box-shadow: inset 0 0 5px rgba(117, 117, 117, .2);
        background: #999
    }

    .cm-content-textarea::-webkit-scrollbar-track {
        box-shadow: inset 0 0 5px rgba(91, 91, 91, .2);
        border-radius: 10px;
        background: #ededed
    }

    .image {
        width: 80px;
        height: 80px;
    }

    .video {
        width: 80px;
        height: 80px;
    }

</style>

<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">


<div style="height: 100% ">
    <ul style="list-style-type: nonel ;height:60rem; overflow: hidden;overflow-y: visible; " class="cm-history-list">
        {foreach name="list" item="vo"}

        {if condition="$vo.from_user != $id"}
        <li class="cm-history-item" style="text-align: left;">
            <div style="margin-left: 20px"> 昵称：
                {if condition="$vo.from_user != $id"}
                <span style="color: #0a5ba6"> {$vo.user_nickname}  </span>
                {else/}
                <span style="color: #0a5ba6"> {$vo.to_user_nickname}  </span>
                {/if}
            </div>
            <div class="cm-history-otherhead cm-history-item-head">
                <img src="{$vo.user_avatar}"/>
            </div>
            <div class="cm-history-othermessage cm-history-item-message">
<!--                <span>{$vo.content}</span>-->
                {if condition="$vo.type =='text' "}
                     <span>{$vo.content}</span>
                {/if}

                {if condition="$vo.type =='image' "}
                    <img class="image" src="{$vo.user_image}"/>
                {/if}

                {if condition="$vo.type =='video' "}
                    <video controls class="video" src="{$vo.user_video}"/>
                {/if}

            </div>
        </li>
        {else/}
        <li class="cm-history-item" style="text-align: right;">
            <div style="margin-right: 20px;">
                <span style="color: #0a5ba6"> {$vo.user_nickname}  </span>
                ：昵称 </div>
            <div class="cm-history-myhead cm-history-item-head">
                <img src="{$vo.user_avatar}"/>
            </div>
            <div class="cm-history-mymessage cm-history-item-message">
<!--                <span>{$vo.content}</span>-->
<!--                <div style="text-align: right;"> {$vo.create_time} </div>-->

                {if condition="$vo.type =='text' "}
                    <span>{$vo.content}</span>
                {/if}

                {if condition="$vo.type =='image' "}
                    <img class="image" src="{$vo.user_image}"/>
                {/if}

                {if condition="$vo.type =='video' "}
                    <video controls class="video" src="{$vo.user_video}"/>
                {/if}

            </div>
        </li>
        {/if}

        {/foreach}

    </ul>

<!--    <div class="cm-content-down" style="height: 12rem">-->
<!--        <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">-->
<!--            <div class="cm-content-input">-->
<!--                <textarea class="cm-content-textarea" style="height: 107px;" name="row[content]"></textarea>-->
<!--            </div>-->
<!--            <input type="hidden" name="row[convenience_message_id]" type="text" value="{$id}"/>-->
<!--            <input type="hidden" name="row[user_id]" type="text" value="0"/>-->
<!--            <div class="cm-send-btn">-->
<!--                <button type="submit" class="btn btn-success btn-embossed">发送(S)</button>-->
<!--            </div>-->
<!--        </form>-->
<!--    </div>-->

</div>


</form>

